#pragma once

#include <boost/asio/ssl.hpp>

#include "http-session.h"


class HttpSessionOnSSL : public HttpSession {
public:
	HttpSessionOnSSL(HttpServer &server, boost::asio::ssl::stream<tcp::socket> &&socket);

	virtual ~HttpSessionOnSSL();

protected:
	virtual void asyncReadHttpRequest(UnderRequestBuffer &requestBuffer, UnderRequest &request, std::function<void(std::error_code ec, size_t readn)> &&cb) override;

	virtual void asyncWriteHttpResponse(const UnderResponse &response, std::function<void(std::error_code ec, size_t readn)> &&cb) override;

private:
	void asyncHandshake();

private:
	boost::asio::ssl::stream<tcp::socket> socket_;
};
